<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of DefaultHTMLPage
 *
 * @author julien
 */
require_once 'Classes/View/AbstractedViewItems/LoginForm.php';
require_once 'Classes/View/AbstractedViewItems/MenuHeader.php';
require_once 'Classes/View/HTMLPage.php';
class DefaultHTMLPage extends HTMLPage{
    
    private $wrapper;
    private $contentTitle;
    private $adminControlls;
    
    public function __construct($title) {
        parent::__construct($title);
     
        $this->wrapper = new ComposedViewItem();
        $this->wrapper->setClass("wrapper");
        $this->contentTitle = new TextFieldItem();
        $this->contentTitle->setClass("title");
        $this->contentTitle->addEndingSpace();
        
        
        
        $this->wrapper->addElement(new MenuHeader());
        $this->wrapper->addElement($this->contentTitle);
        $this->createLink = new LinkItem($_SERVER['REQUEST_URI'].'add',"New");
        $this->createLink->addEndingSpace();
        $this->wrapper->addElement($this->createLink);
        
        parent::addContent($this->wrapper);
    }
    
    
    public function hideNewLink(){
        $this->createLink->unsetVisible();
    }
    
    public function showNewLink(){
        $this->createLink->setVisible();
    }
    
    public function setContentTitle($text){
        $this->contentTitle->setText($text);
    }
    
    
    
    
    public function addContent($content){
        if(is_a($content,'ViewElement')){
            $this->wrapper->addElement($content);
        }
    }
    
}

?>
